import pandas as pd
import itertools

# 读取原始Excel文件
df = pd.read_excel('/Users/Cench/Desktop/VTTxSTxT_1.xlsx')

# 获取VTT、ST和T的所有可能组合
vtt_categories = [1, 2]
st_categories = [1, 2]
t_categories = [1, 2]
combinations = list(itertools.product(vtt_categories, st_categories, t_categories))

# 创建新的DataFrame用于存储结果
result_df = pd.DataFrame(columns=['VTTxSTxT', 'Transmission_Ln'])

# 遍历每个组合，并获取相应的Transmission_Ln值
for combination in combinations:
    vtt, st, t = combination
    combination_name = f'VTT{vtt}xST{st}xT{t}'
    filtered_data = df[(df['VTT'] == vtt) & (df['ST'] == st) & (df['T'] == t)]
    transmission_ln_values = filtered_data['Transmission_Ln'].tolist()
    for transmission_ln in transmission_ln_values:
        result_df = result_df.append({'VTTxSTxT': combination_name, 'Transmission_Ln': transmission_ln}, ignore_index=True)

# 保存结果到新的Excel文件
result_df.to_excel('/Users/Cench/Desktop/VTTxSTxT_2.xlsx', index=False)
